<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>修改密码</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <!--weui.min.css-->
    <link rel="stylesheet" href="/static/index/css/page/base.css"/>
    <link rel="stylesheet" href="/static/index/css/page/font.css"/>
    <link rel="stylesheet" type="text/css" href="/static/index/jquery_weui/lib/weui.min.css">
    <!--jquery-weui.min.css-->
    <link rel="stylesheet" type="text/css" href="/static/index/jquery_weui/css/jquery-weui.min.css">
    <link rel="stylesheet" href="/static/index/css/page/login.css" />

</head>
<body>
<div class="pageControl wallet bg-f5">
    <!--主体-->
    <div class="main">
        <div class="bg-di"></div>
        <div class="msui_nav msui_navTop">
            <a class="msui_navTop-back" href="javascript:history.back();"><i class="micon-back"></i></a>
            <h1 class="msui_navTop-title">修改密码</h1>
        </div>
    </div>
    <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">账号</label></div>
        <div class="weui-cell__bd">
            <input class="weui-input tel" placeholder="请输入账号">
        </div>
    </div>
    <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">旧密码</label></div>
        <div class="weui-cell__bd">
            <input type="password" class="weui-input old_pwd" placeholder="请输入旧密码">
        </div>
    </div>
    <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">新密码</label></div>
        <div class="weui-cell__bd">
            <input type="password" class="weui-input new_pwd" placeholder="请输入新密码">
        </div>
    </div>
    <a href="javascript:;" class="weui-btn weui-btn_primary submit">确认修改</a>
</div>
<!-- jquery-2.1.4 -->
<script type="text/javascript" src="/static/index/jquery_weui/lib/jquery-2.1.4.js"></script>
<!-- jquery-weui.min.js -->
<script type="text/javascript" src="/static/index/jquery_weui/js/jquery-weui.min.js"></script>
<script>
    $('.submit').on('click',function () {
        var tel = $('.tel').val();
        var old_pwd = $('.old_pwd').val();
        var new_pwd = $('.new_pwd').val();
        if(tel == ''){
            alert('账号不能为空！');return;
        }
        if(old_pwd == ''){
            alert('旧密码不能为空！');return;
        }
        if(new_pwd == ''){
            alert('新密码不能为空！');return;
        }
        $.post(
            '/index/login/update_pwd',
            {tel:tel,old_pwd:old_pwd,new_pwd:new_pwd},
            function (data) {
                if(data.code == 200){
                    alert(data.msg);
                    history.go(-1);
                }else{
                    alert(data.msg);
                }
            },'json'
        )
    })
</script>
</body>
</html>

